#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n;
	cin >> n;
	for (int i = n; i >= 0; --i) {
		int m;
		cin >> m;

		if (m > 0 && i != n)
			cout << "+";
		if (m < 0)
			cout << "-";
		if (abs(m) > 1 || m && i == 0)
			cout << abs(m);
		if (m && i > 1)
			cout << "x" << "^" << i;
		if (m && i == 1)
			cout << "x";
	}
	return 0;
}